package cn.wolfcode.domain;

import lombok.Data;

import java.util.List;
@Data
public class Question {
    /** */
    private Long id;

    /** 标题*/
    private String title;

    /** 类型(单选/多选/判断)*/
    private Integer type;

    /** 判断正确(针对判断题才有此项)*/
    private Boolean judgeRight;

    private List<QuestionItem> items;

    public String getAnswer(){
     String   str = "";
     /*   for(Iterator<QuestionItem> it = items.iterator(); it.hasNext();){
            QuestionItem  q=it.next();
            if (q.getJudgeRight()){
                str += q.getTitle();
            }
        }*/
         /*for (int i=0; i<items.size(); i++){
             if (items.get(i).getJudgeRight()){
                 str += items.get(i).getTitle();
             }*/
        for (QuestionItem q:items) {
            if (q.getJudgeRight()){
                str += q.getTitle();
            }
        }
        return str;
     }


    }


